package com.vencent.spring.test;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import com.vencent.spring.bean.Person;
import com.vencent.spring.config.PersonConfig;

/**
 * 注解RunWith自动创建spring's applicationContext,
 * 注解ContextConfiguration从那个地方加载配置信息
 * @author 1d
 *
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes=PersonConfig.class)
public class ApplicationContextStarter {
	
	/**
	 * {@code @Autowired}
	 * Marks a constructor, field, setter method or config method as to be
	 * autowired by Spring's dependency injection facilities.
	 */
	@Autowired
	private Person per;
	
	@Test
	public void playTest(){
		per.play();
	}
}
